package spring.aop.proxy

import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.EnableAspectJAutoProxy

@Configuration
@EnableAspectJAutoProxy
open class SpringAopDemo

//fun main() {
//    val ctx: ApplicationContext = AnnotationConfigApplicationContext("spring.aop.proxy")
//    val service: PointCutService = ctx.getBean("pointCutServiceImpl") as PointCutService
//    service.add()
//}

fun main() {
    val ctx: ApplicationContext = AnnotationConfigApplicationContext("spring.aop.proxy")
    val service: PointCutServiceTwo = ctx.getBean("pointCutServiceTwoImpl") as PointCutServiceTwo
    service.test("1111")
}
